package com.joymart.user.model;

import com.joymart.common.error.handling.JoymartBusinessException;
import lombok.Getter;

/**
 * 业务角色， B/C端用户才能分配
 */
public enum BusinessRole {

    AG_CSR("银顾客"),
    AU_CSR("金顾客"),
    AG_SHOP("银店铺"),
    AU_SHOP("金店铺"),
    AG_WHS("银批发"),
    AU_WHS("金批发"),
    AG_AGENT("银代理"),
    AU_AGENT("金代理"),
    MANAGER("经理"),
    AG_DIRECTOR("总监"),
    AU_DIRECTOR("董事");

    BusinessRole(String text) {
        this.text = text;
    }

    @Getter
    private String text;


    public BusinessRole next(){
        if(BusinessRole.AU_DIRECTOR.equals(this)){
            throw new JoymartBusinessException("top business role");
        }
        return values()[this.ordinal()+1];
    }


}
